<?php

use AppVue\Models\Record;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;

class RecoedSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        for ($i = 0; $i < 100; $i++) {
            $r = new Record();
            $r->name = Str::random('8');
            $r->parent = 0;
            $r->sex = random_int(0, 1) ? '男' : '女';
            $r->serial_number = Str::random(12);
            $r->common = 'Common Text';
            $r->images= json_encode([0 => '/images/1.jpg', 1 => '/images/2.jpg']);
            $r->date = date('Y-m-d');
            $r->description = 'Description Text';
            $r->save();
        }
    }
}
